<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta charset="UTF-8">
		<title>物品详情页面</title>
		<script type="text/javascript" src="../js/jquery.js"></script>
		<script src="../js/jquery.min.js" type="text/javascript"></script>
		<link rel="stylesheet" href="../css/bootstrap.css" />
		<link rel="stylesheet" href="../css/bootstrap.min.css" />
		<link rel="stylesheet" href="../css/main.css" />
		<script type="text/javascript" src="../js/bootstrap.js"></script>
		<script type="text/javascript" src="../js/scrollspy.js"></script>
		<script type="text/javascript" src="../js/login.js"></script>
	</head>

	<body>
		<!--
			标题和图片轮播
		-->
		<div class="container">
			<div class="title row">
				<div class="col-md-12">
					<ol class="titlecontent breadcrumb">
						<li>
							<a href="#">徐州工程学院失物招领平台</a>
						</li>
						<li class="active">首页</li>
						<a href="Register.jsp" id="register" class="login dropdown-toggle">注册 </a>

						<a href="#" id="login" class="login dropdown-toggle" data-toggle="modal" data-target="#loginmodal" style="margin-right: 20px;">登录 </b></a>

					</ol>
				</div>
				<div class="col-md-12">
					<div id="myCarousel" class="carousel slide" data-ride="carousel">
						<!-- 轮播（Carousel）指标 -->
						<ol class="carousel-indicators">
							<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
							<li data-target="#myCarousel" data-slide-to="1"></li>
							<li data-target="#myCarousel" data-slide-to="2"></li>
						</ol>
						<!-- 轮播（Carousel）项目 -->
						<div class="carousel-inner">
							<div class="item active">
								<img src="../img/1.jpg" alt="中心校区">
							</div>
							<div class="item">
								<img src="../img/2.jpg" alt="中心校区北门">
							</div>
							<div class="item">
								<img src="../img/3.jpg" alt="图书馆">
							</div>
						</div>
						<!-- 轮播（Carousel）导航 -->
						<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;
						</a>
						<a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;
						</a>
					</div>
				</div>

				<!--
            	作者：1462859532@qq.com
            	时间：2017-03-28
            	描述：导航条
           -->
				<div class="col-md-12">
					<nav class="navbar navbar-default">
						<div class="container-fluid">
							<div class="navbar-header">
								<a class="navbar-brand active" href="#"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>主页</a>
							</div>
							<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
								<ul class="nav navbar-nav">
									<li class="">
										<a href="Losing.jsp"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>失物信息</a>
									</li>
									<li class="">
										<a href="Finding.jsp"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>寻物信息</a>
									</li>
									<li class="">
										<a href="Guidence.jsp"><span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span>使用指南</a>
									</li>
									
								</ul>
							</div>
						</div>
					</nav>
				</div>

				<div class="col-md-12">
					<div>
						现在的位置 主页-> 物品详情页面
					</div>
				</div>
				<div class="col-md-12">
					<div class="iteminfo col-md-8">
						<form class="forborder form-horizontal">
							<div class="form-group">
								<!--
                                	物件名称
                                -->
								<label for="inputEmail3" class="col-sm-3 control-label">物品类型</label>
								<div class="col-sm-9">
									<input type="name" class="form-control disabled" id="itemsName" placeholder="" readonly>
								</div>
							</div>
							<div class="form-group">
								<!--
                                	时间
                                -->
								<label for="inputEmail3" class="col-sm-3 control-label">时间</label>
								<div class="col-sm-9">
									<input type="name" class="form-control disabled" id="pickerTime" placeholder="" readonly>
								</div>
							</div>
							<div class="form-group">
								<!--
                                	地点
                                -->
								<label for="inputEmail3" class="col-sm-3 control-label">地点</label>
								<div class="col-sm-9">
									<input type="name" class="form-control disabled" id="pickerLoaction" placeholder="" readonly> 
								</div>
							</div>
							<div class="form-group" style="display:none">
								<!--
                                	所属类型
                                -->
								<label for="inputEmail3" class="col-sm-3 control-label">所属类型</label>
								<div class="col-sm-9">
									<input type="name" class="form-control disabled" id="categoryID" placeholder="" readonly>
								</div>
							</div>
							<div class="form-group" style="display:none" id="cardshow">
								<!--
                                	卡号
                                -->
								<label for="inputEmail3" class="col-sm-3 control-label" >卡号</label>
								<div class="col-sm-9">
									<input type="name" class="form-control disabled" id="cardid" placeholder="" readonly>
								</div>
							</div>
							<div class="form-group" id="tempjudge">
								<!--
                                	暂存地点
                                -->
								<label for="inputEmail3" class="col-sm-3 control-label">暂存地点</label>
								<div class="col-sm-9">
									<input type="name" class="form-control disabled" id="locationaddress" placeholder="" readonly>
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-12">
									<a class="btn btn-info" id="phoneshow">查看联系方式</a>
								</div>
							</div>
							<div class="form-group" style="display: none;" id="phoneshow1">
								<!--
                                	联系方式
                               -->
                               <label for="inputEmail3" class="col-sm-3 control-label">联系方式</label>
								<div class="col-sm-9">
									<input type="name" class="form-control disabled" id="phone" placeholder="" readonly>
								</div>
							</div>
							<div class="form-group">
								<!--
                                	图片
                                -->
								<label for="inputEmail3" class="col-sm-3 control-label">图片</label>
								<div class="col-sm-9">
                                     <img  id="picture" style="width:500px;height:300px"/>
								</div>
							</div>
							<!--
                        	作者：1462859532@qq.com
                        	时间：2017-03-29
                        	描述：富文本
                        -->
							<div class="form-group">
								<!--
                                	描述
                                -->
								<label for="inputEmail3" class="col-sm-3 control-label">描述</label>
								<div class="col-sm-9" id="detaildescritton" >
									
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
			<div class="container-fluid" style="text-align: center;">
			丁鑫版权所有@copyright
		    </div>
		    <script type="text/javascript">
		          $(function(){
		        	  $("#phoneshow").click(function(){
		        		  $("#phoneshow1").show();
		        	  })
		        	  //获取网页参数
		        	  function getUrlParam(name)
		        	  {
		        	  var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
		        	  var r = window.location.search.substr(1).match(reg);  //匹配目标参数
		        	  if (r!=null) return unescape(r[2]); return null; //返回参数值
		        	  } 
		        	  var id=getUrlParam("id");	 
		        	  var type=getUrlParam("type");
		        	  if(type==1){
		        		  $.ajax({
			            	  type:"get",
			            	  url:"../user/pickdetail.action?picid="+id,
			            	  dataType:"json",
			            	  success:function(data){
			            		  $("#itemsName").val(data.itemsName);
			            		  $("#pickerTime").val(data.pickerTime);
			            		  $("#pickerLoaction").val(data.itemlocation);
			            		  $("#locationaddress").val(data.locationaddress);
			            		  if(data.phone==null){
			            	    		  $("#phone").val(data.picker+"(无)")
			            		  }else{
			            			  $("#phone").val(data.picker+"("+data.phone+")")
			            		  }
			            		  if(data.cardid!=null){
			            			  $("#cardshow").show();
			            			  $("#cardid").val(data.cardid);
			            		  }
			            		  $("#picture").attr("src","/pic/"+data.picture);
			            		  $("#detaildescritton").append(data.detaildescritton);
			            	  }
			              })
		        	  }else if(type==0){
		        		  $.ajax({
			            	  type:"get",
			            	  url:"../user/losdetail.action?picid="+id,
			            	  dataType:"json",
			            	  success:function(data){
			            		  $("#tempjudge").hide();
			            		  $("#itemsName").val(data.itemsName);
			            		  $("#pickerTime").val(data.losingTime);
			            		  $("#pickerLoaction").val(data.itemLoaction);
			            		  if(data.phone==null){
			            	    		  $("#phone").val(data.userName+"(无)")
			            		  }else{
			            			  $("#phone").val(data.userName+"("+data.phone+")")
			            		  }
			            		  if(data.cardid!=null){
			            			  $("#cardshow").show();
			            			  $("#cardid").val(data.cardid);
			            		  }
			            		  $("#picture").attr("src","/pic/"+data.picture);
			            		  $("#detaildescritton").append(data.detaildescritton);
			            	  }
			              })
		        	  }
		              
		        	  
		          })
		    
		    
		    </script>
	</body>

</html>